package com.panda.web.service.commons.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.panda.web.domain.vo.commons.SomeoneVO;
import com.panda.web.domain.vo.commons.someone.TongYongVO;
import com.panda.web.entity.commons.Addrs;
import com.panda.web.entity.commons.GraduateEdition;
import com.panda.web.mapper.commons.AddrsMapper;
import com.panda.web.mapper.commons.GraduateEditionMapper;
import com.panda.web.service.commons.SomeoneService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Slf4j
@Service
public class SomeoneServiceImpl implements SomeoneService {
    @Autowired
    AddrsMapper addrsMapper;
    @Autowired
    GraduateEditionMapper graduateEditionMapper;
    @Override
    public List<Addrs> addrs(SomeoneVO vo) {
        QueryWrapper<Addrs>  queryWrapper = new QueryWrapper<>();
        if (vo.getName()!=null){
            queryWrapper.like("name",vo.getName());
        }
        List<Addrs> addrsList = addrsMapper.selectList(queryWrapper);
        return addrsList;
    }
    @Override
    public List<GraduateEdition> majorList(SomeoneVO vo) {
        QueryWrapper<GraduateEdition>  queryWrapper = new QueryWrapper<>();
        if (vo.getName()!=null){
            queryWrapper.like("name",vo.getName());
        }
        List<GraduateEdition> addrsList = graduateEditionMapper.selectList(queryWrapper);
        return addrsList;
    }
    //岗位类型
    @Override
    public List<TongYongVO> naturecnList(SomeoneVO vo) {
        List<TongYongVO> voList = new ArrayList<>();
        List<String>naturecnList = new ArrayList<>(Arrays.asList("校招","社招","全职","实习"));
        for (String string : naturecnList) {
            TongYongVO tongYongVO = new TongYongVO();
            tongYongVO.setName(string);
            voList.add(tongYongVO);
        }
        return voList;
    }

    /**
     * 学历
     * @param vo
     * @return
     */
    @Override
    public List<TongYongVO> educationList(SomeoneVO vo) {
        List<String> backgroundList = new ArrayList<>();  //学历
        backgroundList.add("博士");
        backgroundList.add("硕士");
        backgroundList.add("本科");
        backgroundList.add("大专");
//        backgroundList.add("中专");
//        backgroundList.add("中技");
//        backgroundList.add("初中");
//
//        backgroundList.add("高中");
//        backgroundList.add("其他");
//        backgroundList.add("");
//        backgroundList.add("不限");
//        backgroundList.add("专科及以上");
//        backgroundList.add("无学历要求");
//        backgroundList.add("本科及以上");
//        backgroundList.add("硕士及以上");
//        backgroundList.add("博士及以上");
//        backgroundList.add("初中及以下");
        List<TongYongVO> voList = new ArrayList<>();

        for (String string : backgroundList) {
            TongYongVO tongYongVO = new TongYongVO();
            tongYongVO.setName(string);
            voList.add(tongYongVO);
        }
        return voList;
    }


}
